// Raf Lempens
#include "QtSpinner.h"
#include "QtSpinnerActivateAnimation.h"

QtSpinner::QtSpinner(unsigned int initialCellX, unsigned int initialCellY): Spinner(initialCellX, initialCellY), animationLog(0)
{
	spinnerSprite = new QtSpinnerSprite();
}

QtSpinner::~QtSpinner()
{
	if (spinnerSprite)
	{
		delete spinnerSprite;
		spinnerSprite = 0;
	}
}


void QtSpinner::SetAnimationLog(QtAnimationLog* log)
{
	animationLog = log;
}


void QtSpinner::Activate()
{	
	if (animationLog)
	{
		QtSpinnerActivateAnimation command;
		
		command.SetSpinner(spinnerSprite);

		animationLog->AddAnimationCommand(&command);
	}
}

QtSpinnerSprite* QtSpinner::GetSprite() const
{
	return spinnerSprite;
}



